package com.tfblog.exception;

/**
 * Created by FengBin on 2021/5/10 15:04
 * 定义异常类
 */
public enum CodeException {
    //用户 : 10001开始
    UNKNON_USER_EXCEPTION("未知用户异常",10001),
    FALSED_PASSWARD_EXCEPTION("密码错误异常",10002),

    //博客 : 20001开始
    NOTFOUND_BLOG("博客不存在",20001),
    NOTBLOG_TIME("该年月没有博客",20002),

    //分类 : 30001开始
    Duplicate_Type("分类已经存在",30001),
    NOTEXISTED_TYPE("分类不存在",30002),
    EXISTED_BLOG_TYPE("该分类下存在博客,不能删除",30003),

    //标签 : 40001开始
    Duplicate_Tag("标签已经存在",40001),
    NOTEXISTED_Tag("标签不存在",40002),
    EXISTED_BLOG_Tag("该标签下存在博客,不能删除",40003),

    //评论 : 50000开始
    NOTEXISTED_PARENTCOMMENT("该评论没有父评论",50001);

    private String msg;
    private Integer status;

    CodeException(String msg, Integer status) {
        this.msg = msg;
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
